<?php
class UserIdentity extends CUserIdentity {
    public function authenticate() {
        $users=array(
            'admin'=>'admin',
        );
        if(!isset($users[$this->username])) 
            $this->errorCode=self::ERROR_USERNAME_INVALID;
        elseif($users[$this->username]!==$this->password) 
            $this->errorCode=self::ERROR_PASSWORD_INVALID;
        else 
            $this->errorCode=self::ERROR_NONE;
        return !$this->errorCode;
    }
}